package app.server.project.cloud.random.config;

import app.server.project.core.syndb.SynDBMgr;
import cn.hutool.core.util.ClassUtil;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SynDbConfig {

    @Autowired
    private SynDBMgr synDBMgr;

    @PostConstruct
    public void init() {
        var entityClass = ClassUtil.scanPackage("app.server.project.main.service.db.entity");
        synDBMgr.init(entityClass);
        entityClass = ClassUtil.scanPackage("app.server.project.core.globaldao");
        synDBMgr.init(entityClass);
    }
}
